package com.bubblegumproject.ogo.swing.form;

/**
 * Action generated after a form has been processed successfully.
 *
 * TODO: This class could be a TypeParameterizedAction to allow the user to write different handlers for different
 * data responses
 *
 * @author Azubuko Obele (buko.obele@gmail.com)
 */
public class FormSuccess<T> extends FormAction {

    private T result;

    public FormSuccess() {
        ; // do nothing
    }

    public FormSuccess(T data) {
        assert(data != null);
        this.result = data;
    }

    public T getResult() {
        return result;
    }

    public void setResult(T resultData) {
        this.result = resultData;
    }

    public static <U> FormSuccess<U> FormSuccess(U result) {
        return new FormSuccess<U>(result);
    }
}
